package com.wx.common.utils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 获取图片字符串路径中的第一个图片路径
 *
 */
public class ImagePathUtil {

	public  static String firstSourcePath(String path){
		if(path.contains(",")) {
			int first= path.indexOf(",");
			path=path.substring(0, first);
		}
		return path;
	}
	
	public static String[] sourceImagePath(String path) {
		 
		if(path.contains(",")) {
			String[] imagePath=path.split(",");
			return imagePath;
		}else {
			String[] imagePath=new String[] {path};
			return imagePath;
		}
	}
	
	public static void main(String[] args) {
		String[] path=sourceImagePath("group1/M00/00/00/wKgre1siS2SAQ4BMAAA3fdLbqWE242.jpg");
		System.out.println(Arrays.toString(path));
	}
	
	
}
